import 'package:flutter_test/flutter_test.dart';
import 'package:wechat_scan/wechat_scan.dart';
import 'package:wechat_scan/wechat_scan_platform_interface.dart';
import 'package:wechat_scan/wechat_scan_method_channel.dart';
import 'package:plugin_platform_interface/plugin_platform_interface.dart';

class MockWechatScanPlatform
    with MockPlatformInterfaceMixin
    implements WechatScanPlatform {

  @override
  Future<String?> getPlatformVersion() => Future.value('42');
}

void main() {
  final WechatScanPlatform initialPlatform = WechatScanPlatform.instance;

  test('$MethodChannelWechatScan is the default instance', () {
    expect(initialPlatform, isInstanceOf<MethodChannelWechatScan>());
  });

  test('getPlatformVersion', () async {
    WechatScan wechatScanPlugin = WechatScan();
    MockWechatScanPlatform fakePlatform = MockWechatScanPlatform();
    WechatScanPlatform.instance = fakePlatform;

    expect(await wechatScanPlugin.getPlatformVersion(), '42');
  });
}
